package com.fly.util;

/**
 * @Auther: Orchid
 * @Date: 2019/10/8 16:53
 * @Description:
 */
public class Page {

    private int count;//总数
    private int countPage;//总页数
    private int currentPage = 1;//当前页数
    private int pageIndex;//起始页面
    private int pageSize = 5;//页面数量

    public int getPageIndex() {

        return (this.currentPage - 1) * pageSize;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public int getCount() {

        return count;
    }

    public void setCount(int count) {

        this.count = count;
    }

    public int getCountPage() {

        if (count % pageSize == 0){
            countPage = count / pageSize;
        }else{
            countPage = count / pageSize + 1;
        }

        return countPage;
    }

    public void setCountPage(int countPage) {

        this.countPage = countPage;
    }

    public int getCurrentPage() {
        return this.currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
}
